﻿namespace LogParser
{
    using System;
using System.Xml.Serialization;

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://schemas.microsoft.com/bing/bdi/adsyndication/")]
    [XmlRootAttribute(Namespace = "http://schemas.microsoft.com/bing/bdi/adsyndication/")]
    public class AdRequest
    {
        public AdRequest()
        {
            xmlns.Add("ads", "http://schemas.microsoft.com/bing/bdi/adsyndication/");
        }

        public uint? AdUnitId { get; set; }

        public bool ShouldSerializeAdunitId()
        {
            return AdUnitId.HasValue;
        }

        public uint? PageNumber { get; set; }

        public bool ShouldSerializePageNumber()
        {
            return PageNumber.HasValue;
        }

        public uint? PropertyId { get; set; }

        public bool ShouldSerializePropertyId()
        {
            return PropertyId.HasValue;
        }

        public string SourceUserProfile { get; set; }

        public string DynamicTags { get; set; }

        public uint? ChannelId { get; set; }

        public bool ShouldSerializeChannelId()
        {
            return ChannelId.HasValue;
        }

        public int? TransactionType { get; set; }

        public bool ShouldSerializeTransactionType()
        {
            return TransactionType.HasValue;
        }

        public int? DeviceType { get; set; }

        public bool ShouldSerializeDeviceType()
        {
            return DeviceType.HasValue;
        }

        public int? MobileNetworkCode { get; set; }

        public bool ShouldSerializeMobileNetworkCode()
        {
            return MobileNetworkCode.HasValue;
        }

        public int? MobileCountryCode { get; set; }

        public bool ShouldSerializeMobileCountryCode()
        {
            return MobileCountryCode.HasValue;
        }

        public int? MlCount { get; set; }

        public bool ShouldSerializeMlCount()
        {
            return MlCount.HasValue;
        }

        public int? SbCount { get; set; }

        public bool ShouldSerializeSbCount()
        {
            return SbCount.HasValue;
        }

        public string WebSiteCountry { get; set; }

        public string AdLanguage { get; set; }

        // new in V2
        public uint? ClientType { get; set; }

        public bool ShouldSerializeClientType()
        {
            return ClientType.HasValue;
        }

        public bool? EnableRichAds { get; set; }

        public bool ShouldSerializeEnableRichAds()
        {
            return EnableRichAds.HasValue;
        }

        public UInt64? ExpectedRichAdTypes { get; set; }

        public bool ShouldSerializeExpectedRichAdTypes()
        {
            return ExpectedRichAdTypes.HasValue;
        }

        /// <summary>
        /// Expected values are:
        /// 0 = KWD Text/Decoration is DISABLED. Ignore PubCenter Settings for Bolding and Text Decoration.
        /// 1 = KWD Text/Decoration is Enabled based on pubCenter Settings.
        /// 2 = KWD Text/Decoration is Enabled based on Default Settings. pubCenter default settings are ignored.
        /// The default settings that are applied are - Bolding - Tile and Description, Match Type- Substring, Single Character Match - OFF, Font Color - Black
        /// </summary>
        public UInt32? EnableKWDTextDecoration { get; set; }

        public bool ShouldSerializeEnableKWDTextDecoration()
        {
            return EnableKWDTextDecoration.HasValue;
        }

        /// <summary>
        /// 1: RenderReady - Renders <b> and </b> tags (in addition to i, u, and font tags) for hit-highlighting 
        /// 2: CharacterCodes - Renders \uE000 and \uE001 characters for hit-highlighting, similar to web results 
        /// </summary>
        public string KWDTextDecorationMode { get; set; }

        public UInt64? SupportedExtensionsMask { get; set; }

        public bool ShouldSerializeSupportedExtensionsMask()
        {
            return SupportedExtensionsMask.HasValue;
        }

        /// <summary>
        /// DeviceDetection result
        /// Bond schema DeviceCapabilities.DeviceCapabilities_1_0.bond, marshalled using CompactBinaryProtocolWriter
        /// Base64 encoded
        /// </summary>
        public string DeviceCapabilities { get; set; }

        [XmlNamespaceDeclarations]
        public XmlSerializerNamespaces xmlns = new XmlSerializerNamespaces();
    }
}
